package com.youyi.yypermissionlibrary.core.os;

import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;

public class MeiZu implements SettingPage {
    private static final String L_MAIN_CLS = "com.meizu.safe.SecurityMainActivity";
    private static final String N_MAIN_CLS = "com.meizu.safe.permission.PermissionMainActivity";
    private static final String PKG = "com.meizu.safe";
    private Context context;

    public MeiZu(Context context2) {
        this.context = context2;
    }

    private static String getCls() {
        return OsHelper.isAndroidL() ? L_MAIN_CLS : N_MAIN_CLS;
    }

    @Override // com.youyi.yypermissionlibrary.core.os.SettingPage
    public Intent createIntent() throws PackageManager.NameNotFoundException {
        Intent intent = new Intent();
        intent.putExtra("packageName", this.context.getPackageName());
        intent.putExtra(SettingPage.EXTRA_PKG_NAME, this.context.getPackageName());
        intent.putExtra(SettingPage.EXTRA_PKG, this.context.getPackageName());
        intent.setClassName(PKG, getCls());
        if (!OsHelper.isIntentAvailable(this.context, intent) || !OsHelper.isActivityExported(this.context, intent)) {
            return null;
        }
        return intent;
    }
}
